#include <SDL.h>
#include "keydata.h"
#include "SDL_celloskdata.h"

#ifndef CELL_NO_SOFT_INPUT
const CELL_OSK_Key	CELL_OSK_Map[107] = 
{
	{{0, 0, 60, 60},		HID_ESCAPE,				KMOD_NONE,	0},
	{{120, 0, 60, 60},		HID_F1,					KMOD_NONE,	0},
	{{180, 0, 60, 60},		HID_F2,					KMOD_NONE,	0},
	{{240, 0, 60, 60},		HID_F3,					KMOD_NONE,	0},
	{{300, 0, 60, 60},		HID_F4,					KMOD_NONE,	0},
	{{390, 0, 60, 60},		HID_F5,					KMOD_NONE,	0},
	{{450, 0, 60, 60},		HID_F6,					KMOD_NONE,	0},
	{{510, 0, 60, 60},		HID_F7,					KMOD_NONE,	0},
	{{570, 0, 60, 60},		HID_F8,					KMOD_NONE,	0},
	{{660, 0, 60, 60},		HID_F9,					KMOD_NONE,	0},
	{{720, 0, 60, 60},		HID_F10,				KMOD_NONE,	0},
	{{780, 0, 60, 60},		HID_F11,				KMOD_NONE,	0},
	{{840, 0, 60, 60},		HID_F12,				KMOD_NONE,	0},
	{{910, 0, 60, 60},		HID_PRINT,				KMOD_NONE,	0},
	{{970, 0, 60, 60},		HID_SCROLLOCK,			KMOD_NONE,	0},
	{{1030, 0, 60, 60},		HID_PAUSE,				KMOD_NONE,	0},
	{{0, 90, 60, 60},		HID_BACKQUOTE,			KMOD_NONE,	0,	'`',	'~'},
	{{60, 90, 60, 60},		HID_1,					KMOD_NONE,	0,	'1',	'!'},
	{{120, 90, 60, 60},		HID_2,					KMOD_NONE,	0,	'2',	'@'},
	{{180, 90, 60, 60},		HID_3,					KMOD_NONE,	0,	'3',	'#'},
	{{240, 90, 60, 60},		HID_4,					KMOD_NONE,	0,	'4',	'$'},
	{{300, 90, 60, 60},		HID_5,					KMOD_NONE,	0,	'5',	'%'},
	{{360, 90, 60, 60},		HID_6,					KMOD_NONE,	0,	'6',	'^'},
	{{420, 90, 60, 60},		HID_7,					KMOD_NONE,	0,	'7',	'&'},
	{{480, 90, 60, 60},		HID_8,					KMOD_NONE,	0,	'8',	'*'},
	{{540, 90, 60, 60},		HID_9,					KMOD_NONE,	0,	'9',	'('},
	{{600, 90, 60, 60},		HID_0,					KMOD_NONE,	0,	'0',	')'},
	{{660, 90, 60, 60},		HID_MINUS,				KMOD_NONE,	0,	'-',	'_'},
	{{720, 90, 60, 60},		HID_PLUS,				KMOD_NONE,	0,	'=',	'+'},
	{{780, 90, 120, 60},	HID_BACKSPACE,			KMOD_NONE,	0},
	{{910, 90, 60, 60},		HID_INSERT,				KMOD_NONE,	0},
	{{970, 90, 60, 60},		HID_HOME,				KMOD_NONE,	0},
	{{1030, 90, 60, 60},	HID_PAGEUP,				KMOD_NONE,	0},
	{{1095, 90, 60, 60},	HID_NUMLOCK,			KMOD_NONE,	0},
	{{1155, 90, 60, 60},	HID_KP_DIVIDE,			KMOD_NONE,	0,	'/',	'/'},
	{{1215, 90, 60, 60},	HID_KP_MULTIPLY,		KMOD_NONE,	0,	'*',	'*'},
	{{1275, 90, 60, 60},	HID_KP_MINUS,			KMOD_NONE,	0,	'-',	'-'},
	{{0, 150, 90, 60},		HID_TAB,				KMOD_NONE,	0,	'\t',	'\t'},
	{{90, 150, 60, 60},		HID_q,					KMOD_NONE,	0,	'q',	'Q'},
	{{150, 150, 60, 60},	HID_w,					KMOD_NONE,	0,	'w',	'W'},
	{{210, 150, 60, 60},	HID_e,					KMOD_NONE,	0,	'e',	'E'},
	{{270, 150, 60, 60},	HID_r,					KMOD_NONE,	0,	'r',	'R'},
	{{330, 150, 60, 60},	HID_t,					KMOD_NONE,	0,	't',	'T'},
	{{390, 150, 60, 60},	HID_y,					KMOD_NONE,	0,	'y',	'Y'},
	{{450, 150, 60, 60},	HID_u,					KMOD_NONE,	0,	'u',	'U'},
	{{510, 150, 60, 60},	HID_i,					KMOD_NONE,	0,	'i',	'I'},
	{{570, 150, 60, 60},	HID_o,					KMOD_NONE,	0,	'o',	'O'},
	{{630, 150, 60, 60},	HID_p,					KMOD_NONE,	0,	'p',	'P'},
	{{690, 150, 60, 60},	HID_LEFTBRACKET,		KMOD_NONE,	0,	'[',	'{'},
	{{750, 150, 60, 60},	HID_RIGHTBRACKET,		KMOD_NONE,	0,	']',	'}'},
	{{810, 150, 90, 60},	HID_BACKSLASH,			KMOD_NONE,	0,	'\'',	'|'},
	{{910, 150, 60, 60},	HID_DELETE,				KMOD_NONE,	0},
	{{970, 150, 60, 60},	HID_END,				KMOD_NONE,	0},
	{{1030, 150, 60, 60},	HID_PAGEDOWN,			KMOD_NONE,	0},
	{{1095, 150, 60, 60},	HID_KP7,				KMOD_NONE,	0,	'7',	0},
	{{1155, 150, 60, 60},	HID_KP8,				KMOD_NONE,	0,	'8',	0},
	{{1215, 150, 60, 60},	HID_KP9,				KMOD_NONE,	0,	'9',	0},
	{{1275, 150, 60, 120},	HID_KP_PLUS,			KMOD_NONE,	0,	'+',	'+'},
	{{0, 210, 105, 60},		HID_CAPSLOCK,			KMOD_NONE,	0},
	{{105, 210, 60, 60},	HID_a,					KMOD_NONE,	0,	'a',	'A'},
	{{165, 210, 60, 60},	HID_s,					KMOD_NONE,	0,	's',	'S'},
	{{225, 210, 60, 60},	HID_d,					KMOD_NONE,	0,	'd',	'D'},
	{{285, 210, 60, 60},	HID_f,					KMOD_NONE,	0,	'f',	'F'},
	{{345, 210, 60, 60},	HID_g,					KMOD_NONE,	0,	'g',	'G'},
	{{405, 210, 60, 60},	HID_h,					KMOD_NONE,	0,	'h',	'H'},
	{{465, 210, 60, 60},	HID_j,					KMOD_NONE,	0,	'j',	'J'},
	{{525, 210, 60, 60},	HID_k,					KMOD_NONE,	0,	'k',	'K'},
	{{585, 210, 60, 60},	HID_l,					KMOD_NONE,	0,	'l',	'L'},
	{{645, 210, 60, 60},	HID_SEMICOLON,			KMOD_NONE,	0,	';',	':'},
	{{705, 210, 60, 60},	HID_QUOTE,				KMOD_NONE,	0,	'\'',	'\"'},
	{{765, 210, 135, 60},	HID_RETURN,				KMOD_NONE,	0},
	{{1095, 210, 60, 60},	HID_KP4,				KMOD_NONE,	0,	'4',	0},
	{{1155, 210, 60, 60},	HID_KP5,				KMOD_NONE,	0,	'5',	0},
	{{1215, 210, 60, 60},	HID_KP6,				KMOD_NONE,	0,	'6',	0},
	{{0, 270, 135, 60},		HID_NOEVENT,			KMOD_LSHIFT,0},
	{{135, 270, 60, 60},	HID_z,					KMOD_NONE,	0,	'z',	'Z'},
	{{195, 270, 60, 60},	HID_x,					KMOD_NONE,	0,	'x',	'X'},
	{{255, 270, 60, 60},	HID_c,					KMOD_NONE,	0,	'c',	'C'},
	{{315, 270, 60, 60},	HID_v,					KMOD_NONE,	0,	'v',	'V'},
	{{375, 270, 60, 60},	HID_b,					KMOD_NONE,	0,	'b',	'B'},
	{{435, 270, 60, 60},	HID_n,					KMOD_NONE,	0,	'n',	'N'},
	{{495, 270, 60, 60},	HID_m,					KMOD_NONE,	0,	'm',	'M'},
	{{555, 270, 60, 60},	HID_COMMA,				KMOD_NONE,	0,	',',	'<'},
	{{615, 270, 60, 60},	HID_PERIOD,				KMOD_NONE,	0,	'.',	'>'},
	{{675, 270, 60, 60},	HID_SLASH,				KMOD_NONE,	0,	'/',	'?'},
	{{735, 270, 165, 60},	HID_NOEVENT,			KMOD_RSHIFT,0},
	{{970, 270, 60, 60},	HID_UP,					KMOD_NONE,	0},
	{{1095, 270, 60, 60},	HID_KP1,				KMOD_NONE,	0,	'1',	0},
	{{1155, 270, 60, 60},	HID_KP2,				KMOD_NONE,	0,	'2',	0},
	{{1215, 270, 60, 60},	HID_KP3,				KMOD_NONE,	0,	'3',	0},
	{{1275, 270, 60, 120},	HID_KP_ENTER,			KMOD_NONE,	0},
	{{0, 330, 90, 60},		HID_NOEVENT,			KMOD_LCTRL,	0},
	{{90, 330, 60, 60},		HID_NOEVENT,			KMOD_NONE,	0}, //HACK! LSUPER
	{{150, 330, 90, 60},	HID_NOEVENT,			KMOD_LALT,	0},
	{{240, 330, 360, 60},	HID_SPACE,				KMOD_NONE,	0,	' ',	' '},
	{{600, 330, 90, 60},	HID_NOEVENT,			KMOD_RALT,	0},
	{{690, 330, 60, 60},	HID_NOEVENT,			KMOD_NONE,	0},  //HACK! RSUPER
	{{750, 330, 60, 60},	HID_MENU,				KMOD_NONE,	0},
	{{810, 330, 90, 60},	HID_NOEVENT,			KMOD_RCTRL,	0},
	{{910, 330, 60, 60},	HID_LEFT,				KMOD_NONE,	0},
	{{970, 330, 60, 60},	HID_DOWN,				KMOD_NONE,	0},
	{{1030, 330, 60, 60},	HID_RIGHT,				KMOD_NONE,	0},
	{{1095, 330, 120, 60},	HID_KP0,				KMOD_NONE,	0,	'0',	'0'},
	{{1215, 330, 60, 60},	HID_KP_PERIOD,			KMOD_NONE,	0,	'.',	'.'},
	{{1095, 0, 60, 60},		HID_LEFTBUTTON,			KMOD_NONE,	1}, //Left Mouse
	{{1155, 0, 60, 60},		HID_RIGHTBUTTON,		KMOD_NONE,	3}, //Right Mouse
	{{1275, 0, 60, 60},		HID_NOEVENT,			KMOD_NONE,	0,	0,		0,	3}	//Mapping Mode
};

const CELL_OSK_Modifier	CELL_OSK_ModifierMap[6] = 
{
	{{0, 270, 135, 60},		KMOD_LSHIFT,	SDLK_LSHIFT},
	{{735, 270, 165, 60},	KMOD_RSHIFT,	SDLK_RSHIFT},
	{{0, 330, 90, 60},		KMOD_LCTRL,		SDLK_LCTRL},
	{{810, 330, 90, 60},	KMOD_RCTRL,		SDLK_RCTRL},
	{{150, 330, 90, 60},	KMOD_LALT,		SDLK_LALT},
	{{600, 330, 90, 60},	KMOD_RALT,		SDLK_RALT},
};

const SDLMod	CELL_OSK_ModifierIndex[6] = {KMOD_LSHIFT,				KMOD_RSHIFT,				KMOD_LCTRL,				KMOD_RCTRL,				KMOD_LALT,				KMOD_RALT};

#endif
